using System;
using System.Windows.Forms;

namespace PSSymbolStore.Manager.Windows
{
    public partial class AboutDialog : Form
    {
        public AboutDialog()
        {
            InitializeComponent();
        }

        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            LaunchUrl(linkLabel1.Text);
        }

        private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            LaunchUrl("mailto:" + linkLabel2.Text);
        }

        private void LaunchUrl(string url)
        {
            try
            {
                System.Diagnostics.Process.Start(url);
            }
            catch
            { }
        }

        private void btnResetSettings_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("This will reset all saved settings such as window positions, recent symbol server locations, etc. Continue?", "Are you sure?", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
            {
                try
                {
                    Properties.Settings.Default.Reset();
                }
                catch
                { }
            }
        }
    }
}